home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4914 < prev    next >
Mailbox/MIME Entity  |  1996-08-06  |  3.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 66 65 65 64 2e 67 |Path: ne|wsfeed.g|
|00000010| 73 66 63 2e 6e 61 73 61 | 2e 67 6f 76 21 75 73 65 |sfc.nasa|.gov!use|
|00000020| 6e 65 74 0a 46 72 6f 6d | 3a 20 44 69 72 6b 20 42 |net.From|: Dirk B|
|00000030| 72 6f 65 72 20 3c 44 69 | 72 6b 2e 42 72 6f 65 72 |roer <Di|rk.Broer|
|00000040| 40 67 73 66 63 2e 6e 61 | 73 61 2e 67 6f 76 3e 0a |@gsfc.na|sa.gov>.|
|00000050| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000060| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 53 75 62 6a 65 63 |.lang.c+|+.Subjec|
|00000070| 74 3a 20 52 65 3a 20 53 | 6f 20 49 20 68 61 76 65 |t: Re: S|o I have|
|00000080| 20 74 68 69 73 20 70 6f | 69 6e 74 65 72 2d 74 6f | this po|inter-to|
|00000090| 2d 6d 65 6d 62 65 72 20 | 66 75 6e 63 74 69 6f 6e |-member |function|
|000000a0| 2e 2e 2e 0a 44 61 74 65 | 3a 20 53 75 6e 2c 20 32 |....Date|: Sun, 2|
|000000b0| 38 20 4a 61 6e 20 31 39 | 39 36 20 31 31 3a 34 35 |8 Jan 19|96 11:45|
|000000c0| 3a 30 38 20 2d 30 38 30 | 30 0a 4f 72 67 61 6e 69 |:08 -080|0.Organi|
|000000d0| 7a 61 74 69 6f 6e 3a 20 | 4e 41 53 41 20 47 6f 64 |zation: |NASA God|
|000000e0| 64 61 72 64 20 53 70 61 | 63 65 20 46 6c 69 67 68 |dard Spa|ce Fligh|
|000000f0| 74 20 43 65 6e 74 65 72 | 20 2d 2d 20 47 72 65 65 |t Center| -- Gree|
|00000100| 6e 62 65 6c 74 2c 20 4d | 61 72 79 6c 61 6e 64 20 |nbelt, M|aryland |
|00000110| 55 53 41 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |USA.Mess|age-ID: |
|00000120| 3c 33 31 30 42 44 32 34 | 34 2e 33 33 31 43 40 67 |<310BD24|4.331C@g|
|00000130| 73 66 63 2e 6e 61 73 61 | 2e 67 6f 76 3e 0a 52 65 |sfc.nasa|.gov>.Re|
|00000140| 66 65 72 65 6e 63 65 73 | 3a 20 3c 64 34 63 31 2e |ferences|: <d4c1.|
|00000150| 73 6d 61 69 6c 2e 73 6d | 61 79 6f 40 74 69 61 63 |smail.sm|ayo@tiac|
|00000160| 2e 6e 65 74 3e 0a 4e 4e | 54 50 2d 50 6f 73 74 69 |.net>.NN|TP-Posti|
|00000170| 6e 67 2d 48 6f 73 74 3a | 20 63 6f 6e 74 72 6f 6c |ng-Host:| control|
|00000180| 2e 67 73 66 63 2e 6e 61 | 73 61 2e 67 6f 76 0a 4d |.gsfc.na|sa.gov.M|
|00000190| 69 6d 65 2d 56 65 72 73 | 69 6f 6e 3a 20 31 2e 30 |ime-Vers|ion: 1.0|
|000001a0| 0a 43 6f 6e 74 65 6e 74 | 2d 54 79 70 65 3a 20 74 |.Content|-Type: t|
|000001b0| 65 78 74 2f 70 6c 61 69 | 6e 3b 20 63 68 61 72 73 |ext/plai|n; chars|
|000001c0| 65 74 3d 75 73 2d 61 73 | 63 69 69 0a 43 6f 6e 74 |et=us-as|cii.Cont|
|000001d0| 65 6e 74 2d 54 72 61 6e | 73 66 65 72 2d 45 6e 63 |ent-Tran|sfer-Enc|
|000001e0| 6f 64 69 6e 67 3a 20 37 | 62 69 74 0a 58 2d 4d 61 |oding: 7|bit.X-Ma|
|000001f0| 69 6c 65 72 3a 20 4d 6f | 7a 69 6c 6c 61 20 32 2e |iler: Mo|zilla 2.|
|00000200| 30 62 35 20 28 57 69 6e | 31 36 3b 20 49 29 0a 54 |0b5 (Win|16; I).T|
|00000210| 6f 3a 20 53 63 6f 74 74 | 20 4d 61 79 6f 20 3c 73 |o: Scott| Mayo <s|
|00000220| 6d 61 79 6f 40 74 69 61 | 63 2e 6e 65 74 3e 0a 0a |mayo@tia|c.net>..|
|00000230| 53 63 6f 74 74 20 4d 61 | 79 6f 20 77 72 6f 74 65 |Scott Ma|yo wrote|
|00000240| 3a 0a 3e 20 0a 3e 20 49 | 27 6d 20 74 72 79 69 6e |:.> .> I|'m tryin|
|00000250| 67 20 74 6f 20 64 6f 20 | 73 6f 6d 65 74 68 69 6e |g to do |somethin|
|00000260| 67 20 69 6e 20 43 2b 2b | 20 77 68 69 63 68 20 69 |g in C++| which i|
|00000270| 6e 73 74 69 6e 63 74 20 | 74 65 6c 6c 73 20 6d 65 |nstinct |tells me|
|00000280| 20 73 68 6f 75 6c 64 6e | 27 74 20 62 65 20 68 61 | shouldn|'t be ha|
|00000290| 72 64 20 74 6f 0a 3e 20 | 61 72 72 61 6e 67 65 2c |rd to.> |arrange,|
|000002a0| 20 62 75 74 20 74 68 65 | 20 63 6f 6d 70 69 6c 65 | but the| compile|
|000002b0| 72 20 69 73 6e 27 74 20 | 63 6f 6f 70 65 72 61 74 |r isn't |cooperat|
|000002c0| 69 6e 67 2e 0a 3e 20 0a | 3e 20 49 20 68 61 76 65 |ing..> .|> I have|
|000002d0| 20 61 20 63 6c 61 73 73 | 2c 20 63 61 6c 6c 20 69 | a class|, call i|
|000002e0| 74 20 43 2c 20 77 68 6f | 73 65 20 70 75 72 70 6f |t C, who|se purpo|
|000002f0| 73 65 20 69 6e 20 6c 69 | 66 65 20 69 73 20 74 6f |se in li|fe is to|
|00000300| 20 61 63 71 75 69 72 65 | 20 61 6e 20 69 6e 70 75 | acquire| an inpu|
|00000310| 74 0a 3e 20 73 74 72 65 | 61 6d 2c 20 70 61 72 73 |t.> stre|am, pars|
|00000320| 65 20 69 74 20 69 6e 74 | 6f 20 74 6f 6b 65 6e 73 |e it int|o tokens|
|00000330| 2c 20 61 6e 64 20 74 68 | 65 6e 20 68 61 76 65 20 |, and th|en have |
|00000340| 74 68 65 20 74 6f 6b 65 | 6e 73 20 74 65 6c 6c 20 |the toke|ns tell |
|00000350| 69 74 20 77 68 69 63 68 | 20 6d 65 6d 62 65 72 0a |it which| member.|
|00000360| 3e 20 66 75 6e 63 74 69 | 6f 6e 73 20 74 6f 20 63 |> functi|ons to c|
|00000370| 61 6c 6c 2e 20 46 6f 72 | 20 74 6f 6b 65 6e 20 22 |all. For| token "|
|00000380| 41 22 20 63 61 6c 6c 20 | 6d 65 6d 62 65 72 20 66 |A" call |member f|
|00000390| 75 6e 63 74 69 6f 6e 20 | 41 2c 20 61 6e 64 20 73 |unction |A, and s|
|000003a0| 6f 20 6f 6e 2e 20 41 6e | 20 61 72 72 61 79 0a 3e |o on. An| array.>|
|000003b0| 20 6f 66 20 73 74 72 75 | 63 74 20 7b 63 68 61 72 | of stru|ct {char|
|000003c0| 20 2a 74 6f 6b 65 6e 3b | 20 76 6f 69 64 20 28 43 | *token;| void (C|
|000003d0| 3a 3a 2a 66 29 28 29 3b | 7d 20 66 69 74 73 20 74 |::*f)();|} fits t|
|000003e0| 68 65 20 62 69 6c 6c 20 | 77 65 6c 6c 20 65 6e 6f |he bill |well eno|
|000003f0| 75 67 68 20 74 6f 20 6d | 61 6e 61 67 65 0a 3e 20 |ugh to m|anage.> |
|00000400| 74 68 61 74 2e 0a 3e 20 | 0a 3e 20 4e 6f 77 20 74 |that..> |.> Now t|
|00000410| 68 65 20 74 72 69 63 6b | 79 20 70 61 72 74 2e 20 |he trick|y part. |
|00000420| 49 20 77 61 6e 74 20 74 | 6f 20 64 65 72 69 76 65 |I want t|o derive|
|00000430| 20 63 6c 61 73 73 20 43 | 31 20 61 6e 64 20 43 32 | class C|1 and C2|
|00000440| 20 66 72 6f 6d 20 43 2e | 20 41 6e 64 20 49 20 77 | from C.| And I w|
|00000450| 61 6e 74 20 43 31 0a 3e | 20 28 61 6e 64 20 43 32 |ant C1.>| (and C2|
|00000460| 2c 20 65 74 63 29 20 74 | 6f 20 68 61 76 65 20 74 |, etc) t|o have t|
|00000470| 68 65 69 72 20 6f 77 6e | 20 73 75 63 68 20 74 61 |heir own| such ta|
|00000480| 62 6c 65 20 66 6f 72 20 | 6d 61 70 70 69 6e 67 20 |ble for |mapping |
|00000490| 74 6f 6b 65 6e 73 20 74 | 6f 20 6d 65 6d 62 65 72 |tokens t|o member|
|000004a0| 0a 3e 20 66 75 6e 63 74 | 69 6f 6e 73 3b 20 69 6e |.> funct|ions; in|
|000004b0| 20 74 68 65 20 61 62 73 | 65 6e 63 65 20 6f 66 20 | the abs|ence of |
|000004c0| 61 20 6d 61 74 63 68 2c | 20 49 20 77 61 6e 74 20 |a match,| I want |
|000004d0| 74 6f 20 67 6f 20 75 70 | 20 61 6e 64 20 73 65 61 |to go up| and sea|
|000004e0| 72 63 68 20 43 27 73 20 | 74 61 62 6c 65 20 61 6e |rch C's |table an|
|000004f0| 64 0a 3e 20 75 73 65 20 | 77 68 61 74 20 49 20 66 |d.> use |what I f|
|00000500| 69 6e 64 20 74 68 65 72 | 65 2e 0a 3e 20 0a 3e 20 |ind ther|e..> .> |
|00000510| 22 41 68 2c 22 20 49 20 | 69 6e 6e 6f 63 65 6e 74 |"Ah," I |innocent|
|00000520| 6c 79 20 74 68 6f 75 67 | 68 74 2c 20 22 49 27 6c |ly thoug|ht, "I'l|
|00000530| 6c 20 6a 75 73 74 20 6d | 61 6b 65 20 65 61 63 68 |l just m|ake each|
|00000540| 20 61 72 72 61 79 20 6f | 66 20 73 74 72 75 63 74 | array o|f struct|
|00000550| 20 61 20 73 74 61 74 69 | 63 0a 3e 20 76 61 72 69 | a stati|c.> vari|
|00000560| 61 62 6c 65 20 69 6e 73 | 69 64 65 20 74 68 65 20 |able ins|ide the |
|00000570| 63 6c 61 73 73 20 64 65 | 66 69 6e 69 74 69 6f 6e |class de|finition|
|00000580| 20 69 74 20 67 6f 65 73 | 20 77 69 74 68 2c 20 61 | it goes| with, a|
|00000590| 6e 64 20 74 68 65 6e 20 | 69 74 20 77 69 6c 6c 20 |nd then |it will |
|000005a0| 62 65 20 65 61 73 79 20 | 74 6f 0a 3e 20 61 75 74 |be easy |to.> aut|
|000005b0| 6f 6d 61 74 69 63 61 6c | 6c 79 20 73 65 61 72 63 |omatical|ly searc|
|000005c0| 68 20 74 68 65 20 72 69 | 67 68 74 20 74 61 62 6c |h the ri|ght tabl|
|000005d0| 65 20 61 74 20 74 68 65 | 20 72 69 67 68 74 20 74 |e at the| right t|
|000005e0| 69 6d 65 2e 22 0a 3e 20 | 0a 3e 20 54 68 65 20 63 |ime.".> |.> The c|
|000005f0| 6f 6d 70 69 6c 65 72 20 | 77 69 6c 6c 20 68 61 76 |ompiler |will hav|
|00000600| 65 20 6e 6f 6e 65 20 6f | 66 20 69 74 2e 20 49 74 |e none o|f it. It|
|00000610| 20 74 61 6b 65 73 20 6f | 6e 65 20 67 6c 61 6e 63 | takes o|ne glanc|
|00000620| 65 20 61 74 20 74 68 65 | 20 73 74 61 74 69 63 20 |e at the| static |
|00000630| 73 74 72 75 63 74 0a 3e | 20 7b 63 68 61 72 2a 6e |struct.>| {char*n|
|00000640| 61 6d 65 3b 20 76 6f 69 | 64 20 28 43 3a 3a 2a 66 |ame; voi|d (C::*f|
|00000650| 29 28 29 3b 7d 20 6c 69 | 73 74 5b 5d 20 3d 20 7b |)();} li|st[] = {|
|00000660| 22 41 22 2c 20 43 3a 3a | 41 7d 3b 20 61 6e 64 20 |"A", C::|A}; and |
|00000670| 68 61 73 20 61 20 68 69 | 73 73 79 20 66 69 74 20 |has a hi|ssy fit |
|00000680| 61 74 20 74 68 65 0a 3e | 20 61 74 74 65 6d 70 74 |at the.>| attempt|
|00000690| 20 74 6f 20 61 73 73 69 | 67 6e 20 69 6e 69 74 69 | to assi|gn initi|
|000006a0| 61 6c 69 7a 65 72 73 2e | 20 49 74 27 73 20 66 69 |alizers.| It's fi|
|000006b0| 6e 65 20 6f 75 74 73 69 | 64 65 20 74 68 65 20 63 |ne outsi|de the c|
|000006c0| 6c 61 73 73 20 64 65 66 | 69 6e 69 74 69 6f 6e 3b |lass def|inition;|
|000006d0| 20 69 74 0a 3e 20 77 6f | 6e 27 74 20 77 6f 72 6b | it.> wo|n't work|
|000006e0| 20 69 6e 73 69 64 65 2e | 0a 0a 41 6d 20 49 20 6d | inside.|..Am I m|
|000006f0| 69 73 73 69 6e 67 20 73 | 6f 6d 65 74 68 69 6e 67 |issing s|omething|
|00000700| 3f 20 20 49 20 74 68 69 | 6e 6b 20 61 6c 6c 20 73 |? I thi|nk all s|
|00000710| 74 61 74 69 63 73 20 68 | 61 76 65 20 74 6f 20 62 |tatics h|ave to b|
|00000720| 65 20 69 6e 69 74 69 61 | 6c 69 7a 65 64 20 6f 75 |e initia|lized ou|
|00000730| 74 73 69 64 65 20 0a 74 | 68 65 20 63 6c 61 73 73 |tside .t|he class|
|00000740| 2e 20 20 53 74 61 74 69 | 63 73 20 61 72 65 20 6e |. Stati|cs are n|
|00000750| 6f 74 20 72 65 61 6c 6c | 79 20 63 6c 61 73 73 20 |ot reall|y class |
|00000760| 6d 65 6d 62 65 72 73 20 | 6c 69 6b 65 20 74 68 65 |members |like the|
|00000770| 20 6f 74 68 65 72 20 76 | 61 72 69 61 62 6c 65 73 | other v|ariables|
|00000780| 2c 20 0a 62 75 74 20 74 | 68 65 79 20 61 72 65 20 |, .but t|hey are |
|00000790| 67 6c 6f 62 61 6c 20 77 | 69 74 68 20 76 69 73 61 |global w|ith visa|
|000007a0| 62 69 6c 69 74 79 20 63 | 6f 6e 74 72 6f 6c 65 64 |bility c|ontroled|
|000007b0| 20 62 79 20 74 68 65 20 | 63 6c 61 73 73 2e 20 20 | by the |class. |
|000007c0| 4d 65 61 6e 69 6e 67 2c | 20 74 68 65 20 0a 63 6c |Meaning,| the .cl|
|000007d0| 61 73 73 20 63 6f 6e 74 | 72 6f 6c 73 20 77 68 6f |ass cont|rols who|
|000007e0| 20 73 65 65 73 20 74 68 | 65 20 73 74 72 75 63 74 | sees th|e struct|
|000007f0| 75 72 65 2c 20 62 75 74 | 20 74 68 65 20 73 74 72 |ure, but| the str|
|00000800| 75 63 74 75 72 65 20 69 | 73 20 6e 6f 74 20 70 61 |ucture i|s not pa|
|00000810| 72 74 20 6f 66 20 74 68 | 65 20 0a 63 6c 61 73 73 |rt of th|e .class|
|00000820| 2e 0a 20 0a 3e 20 49 20 | 63 61 6e 20 63 6c 65 61 |.. .> I |can clea|
|00000830| 72 6c 79 20 6a 75 73 74 | 20 70 75 74 20 74 68 65 |rly just| put the|
|00000840| 20 61 72 72 61 79 73 20 | 6f 75 74 73 69 64 65 20 | arrays |outside |
|00000850| 74 68 65 20 63 6c 61 73 | 73 20 64 65 66 69 6e 69 |the clas|s defini|
|00000860| 74 69 6f 6e 73 2c 20 61 | 6e 64 20 6a 75 73 74 0a |tions, a|nd just.|
|00000870| 3e 20 74 65 61 63 68 20 | 74 68 65 20 63 6c 61 73 |> teach |the clas|
|00000880| 73 20 22 73 65 61 72 63 | 68 22 20 66 75 6e 63 74 |s "searc|h" funct|
|00000890| 69 6f 6e 20 74 6f 20 6b | 6e 6f 77 20 77 68 69 63 |ion to k|now whic|
|000008a0| 68 20 61 72 72 61 79 20 | 74 6f 20 67 6f 20 61 66 |h array |to go af|
|000008b0| 74 65 72 2c 20 62 75 74 | 20 69 74 0a 3e 20 73 65 |ter, but| it.> se|
|000008c0| 65 6d 73 20 63 72 61 73 | 73 2e 20 54 68 61 74 20 |ems cras|s. That |
|000008d0| 61 72 72 61 79 20 69 73 | 20 6c 6f 67 69 63 61 6c |array is| logical|
|000008e0| 6c 79 20 61 20 70 61 72 | 74 20 6f 66 20 74 68 65 |ly a par|t of the|
|000008f0| 20 63 6c 61 73 73 20 62 | 65 68 61 76 69 6f 75 72 | class b|ehaviour|
|00000900| 2c 20 61 6e 64 20 69 66 | 20 0a 0a 50 65 72 68 61 |, and if| ..Perha|
|00000910| 70 73 20 79 6f 75 20 63 | 6f 75 6c 64 20 69 6e 69 |ps you c|ould ini|
|00000920| 74 69 61 6c 69 7a 65 20 | 74 68 65 6d 20 69 6e 20 |tialize |them in |
|00000930| 74 68 65 20 63 6f 6e 73 | 74 72 75 63 74 6f 72 3f |the cons|tructor?|
|00000940| 0a 0a 3e 20 65 6e 64 20 | 75 70 20 63 72 65 61 74 |..> end |up creat|
|00000950| 69 6e 67 20 61 20 6c 6f | 74 20 6f 66 20 74 68 65 |ing a lo|t of the|
|00000960| 73 65 20 73 75 62 63 6c | 61 73 73 65 73 2c 20 49 |se subcl|asses, I|
|00000970| 20 64 6f 6e 27 74 20 77 | 61 6e 74 20 74 6f 20 72 | don't w|ant to r|
|00000980| 65 6c 79 20 6f 6e 0a 3e | 20 72 65 6d 65 6d 62 65 |ely on.>| remembe|
|00000990| 72 69 6e 67 20 74 6f 20 | 74 65 6c 6c 20 65 61 63 |ring to |tell eac|
|000009a0| 68 20 73 65 61 72 63 68 | 20 66 75 6e 63 74 69 6f |h search| functio|
|000009b0| 6e 20 77 68 69 63 68 20 | 6d 61 67 69 63 20 61 72 |n which |magic ar|
|000009c0| 72 61 79 20 74 6f 20 75 | 73 65 2e 0a 3e 20 0a 3e |ray to u|se..> .>|
|000009d0| 20 53 75 67 67 65 73 74 | 69 6f 6e 73 3f 20 41 6d | Suggest|ions? Am|
|000009e0| 20 49 20 6d 69 73 73 69 | 6e 67 20 73 6f 6d 65 74 | I missi|ng somet|
|000009f0| 68 69 6e 67 20 73 69 6d | 70 6c 65 20 61 6e 64 20 |hing sim|ple and |
|00000a00| 75 73 65 66 75 6c 20 68 | 65 72 65 3f 20 54 68 61 |useful h|ere? Tha|
|00000a10| 6e 6b 73 2e 20 4d 61 69 | 6c 0a 3e 20 61 70 70 72 |nks. Mai|l.> appr|
|00000a20| 65 63 69 61 74 65 64 2c | 20 70 6f 73 74 69 6e 67 |eciated,| posting|
|00000a30| 20 6d 69 67 68 74 20 62 | 65 20 6d 69 73 73 65 64 | might b|e missed|
|00000a40| 2e 0a 0a 59 6f 75 20 63 | 61 6e 20 61 6c 73 6f 20 |...You c|an also |
|00000a50| 70 75 74 20 74 68 65 20 | 61 72 72 61 79 73 20 69 |put the |arrays i|
|00000a60| 6e 20 74 68 65 20 70 72 | 69 76 61 74 65 20 73 65 |n the pr|ivate se|
|00000a70| 63 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 63 6c 61 |ction of| the cla|
|00000a80| 73 73 20 64 65 66 69 6e | 69 74 69 6f 6e 2e 0a 52 |ss defin|ition..R|
|00000a90| 65 64 65 66 69 6e 65 20 | 74 68 65 20 73 65 61 72 |edefine |the sear|
|00000aa0| 63 68 20 66 75 6e 63 74 | 69 6f 6e 20 69 6e 20 74 |ch funct|ion in t|
|00000ab0| 68 65 20 64 65 72 69 76 | 65 64 20 63 6c 61 73 73 |he deriv|ed class|
|00000ac0| 2e 20 20 53 6f 6d 65 74 | 68 69 6e 67 20 6c 69 6b |. Somet|hing lik|
|00000ad0| 65 20 74 68 69 73 0a 0a | 63 6c 61 73 73 20 43 31 |e this..|class C1|
|00000ae0| 20 3a 20 43 3b 0a 0a 52 | 45 53 55 4c 54 09 43 31 | : C;..R|ESULT.C1|
|00000af0| 3a 3a 53 65 61 72 63 68 | 28 20 3f 20 29 0a 7b 0a |::Search|( ? ).{.|
|00000b00| 20 20 20 20 69 66 2e 2e | 2e 2e 0a 09 72 65 74 75 | if..|....retu|
|00000b10| 72 6e 20 72 65 73 75 6c | 74 3b 0a 20 20 20 20 65 |rn resul|t;. e|
|00000b20| 6c 73 65 0a 20 20 20 20 | 20 20 20 72 65 74 75 72 |lse. | retur|
|00000b30| 6e 20 43 3a 3a 53 65 61 | 72 63 68 28 20 3f 20 29 |n C::Sea|rch( ? )|
|00000b40| 3b 0a 7d 0a 0a 59 6f 75 | 72 20 73 65 61 72 63 68 |;.}..You|r search|
|00000b50| 20 6c 69 73 74 20 77 69 | 6c 6c 20 70 72 6f 62 61 | list wi|ll proba|
|00000b60| 62 6c 79 20 68 61 76 65 | 20 74 6f 20 68 61 76 65 |bly have| to have|
|00000b70| 20 64 69 66 66 65 72 65 | 6e 74 20 6e 61 6d 65 73 | differe|nt names|
|00000b80| 20 69 6e 20 62 6f 74 68 | 20 74 68 65 20 43 20 0a | in both| the C .|
|00000b90| 63 6c 61 73 73 20 61 6e | 64 20 74 68 65 20 43 31 |class an|d the C1|
|00000ba0| 20 63 6c 61 73 73 2e 0a | 49 66 20 79 6f 75 20 68 | class..|If you h|
|00000bb0| 61 76 65 20 61 20 70 72 | 6f 62 61 62 6c 65 6d 20 |ave a pr|obablem |
|00000bc0| 69 6e 69 74 69 61 6c 69 | 7a 69 6e 67 20 74 68 65 |initiali|zing the|
|00000bd0| 20 6c 69 73 74 20 69 74 | 73 20 75 73 75 61 6c 6c | list it|s usuall|
|00000be0| 79 20 73 6f 6d 65 74 68 | 69 6e 67 20 79 6f 75 20 |y someth|ing you |
|00000bf0| 63 61 6e 20 0a 64 6f 20 | 69 6e 20 74 68 65 20 63 |can .do |in the c|
|00000c00| 6f 6e 73 74 72 75 63 74 | 6f 72 20 2d 20 61 6c 74 |onstruct|or - alt|
|00000c10| 68 6f 75 67 68 20 79 6f | 75 20 6d 61 79 20 68 61 |hough yo|u may ha|
|00000c20| 76 65 20 74 6f 20 69 6e | 69 74 69 61 6c 69 7a 65 |ve to in|itialize|
|00000c30| 20 74 68 65 20 6c 69 73 | 74 20 73 69 7a 65 20 6f | the lis|t size o|
|00000c40| 72 20 0a 64 79 6e 61 6d | 69 63 61 6c 6c 79 20 61 |r .dynam|ically a|
|00000c50| 6c 6c 6f 63 61 74 65 20 | 69 74 2e 0a 0a 44 69 72 |llocate |it...Dir|
|00000c60| 6b 0a | |k. | |
+--------+-------------------------+-------------------------+--------+--------+